/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.shelf.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import cn.edu.pku.wxlib.shelf.model.*;
import cn.edu.pku.wxlib.shelf.service.*;
import cn.edu.pku.wxlib.shelf.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


public class Shelf extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Shelf";
	public static final String ALIAS_SHELF_ID = "shelfId";
	public static final String ALIAS_SHELF_NUMBER = "shelfNumber";
	public static final String ALIAS_SHELF_NAME = "shelfName";
	public static final String ALIAS_PRICE = "price";
	public static final String ALIAS_CREATE_TIME = "createTime";
	public static final String ALIAS_STATE = "1启用，0禁用";
	
	//date formats
	public static final String FORMAT_CREATE_TIME = DATE_FORMAT;
	
	//columns START
    /** shelfId       db_column: shelfId */	
	
	private java.lang.Integer shelfId;
    /** shelfNumber       db_column: shelfNumber */	
	@NotBlank @Length(max=6)
	private java.lang.String shelfNumber;
    /** shelfName       db_column: shelfName */	
	@Length(max=32)
	private java.lang.String shelfName;
    /** price       db_column: price */	
	
	private java.lang.Double price;
    /** createTime       db_column: createTime */	
	
	private java.util.Date createTime;
    /** 1启用，0禁用       db_column: state */	
	
	private java.lang.Integer state;
	//columns END

	public Shelf(){
	}

	public Shelf(
		java.lang.Integer shelfId
	){
		this.shelfId = shelfId;
	}

	public void setShelfId(java.lang.Integer value) {
		this.shelfId = value;
	}
	
	public java.lang.Integer getShelfId() {
		return this.shelfId;
	}
	public void setShelfNumber(java.lang.String value) {
		this.shelfNumber = value;
	}
	
	public java.lang.String getShelfNumber() {
		return this.shelfNumber;
	}
	public void setShelfName(java.lang.String value) {
		this.shelfName = value;
	}
	
	public java.lang.String getShelfName() {
		return this.shelfName;
	}
	public void setPrice(java.lang.Double value) {
		this.price = value;
	}
	
	public java.lang.Double getPrice() {
		return this.price;
	}
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
		setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	public void setState(java.lang.Integer value) {
		this.state = value;
	}
	
	public java.lang.Integer getState() {
		return this.state;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("ShelfId",getShelfId())
			.append("ShelfNumber",getShelfNumber())
			.append("ShelfName",getShelfName())
			.append("Price",getPrice())
			.append("CreateTime",getCreateTime())
			.append("State",getState())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getShelfId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Shelf == false) return false;
		if(this == obj) return true;
		Shelf other = (Shelf)obj;
		return new EqualsBuilder()
			.append(getShelfId(),other.getShelfId())
			.isEquals();
	}
}

